feat: implement issues #178, #179, #180, #181#201
Merged
Chucks1093 merged 1 commit intoApr 26, 2026
Conversation
…layerorg#180, accesslayerorg#181 - accesslayerorg#178 Service-layer tests for creator flows: 13 new Jest tests across creator.service.test.ts (pagination math, sort options, parallel query, edge cases) and creator-profile.service.test.ts (read shape, upsert envelope, schema-boundary contract). Tests mock prisma at the module boundary so they stay isolated from unrelated modules. - accesslayerorg#179 Seed/fixture guidance: idempotent prisma/seed.ts that creates three deterministic users (alice / bob / charlie) with wallets and creator profiles, plus docs/contributor-seed.md describing the fixture catalogue, reset workflow, and example requests for the most common dev scenarios. CONTRIBUTING.md links the new doc. - accesslayerorg#180 Release checklist: docs/release-checklist.md with pre-deploy / rollout / post-deploy / rollback sections. Concrete and operational (real commands, real endpoint names) so a contributor can use it cold without additional context. - accesslayerorg#181 Wallet-ownership gated access: new utils/wallet-ownership.utils.ts helper exposes a single typed verdict (granted / wallet_not_found / forbidden), and middlewares/wallet-ownership.middleware.ts applies it with consistent { code: 'UNAUTHORIZED' | 'FORBIDDEN', message } error shape. Wired into PUT /api/v1/creators/:creatorId/profile (previously open). 13 new tests cover authorized + unauthorized paths. Total: 26 new passing tests across 4 new test files. No regressions — the 8 pre-existing test-suite failures on main ("Your test suite must contain at least one test" — older bespoke test scripts) are unchanged. pnpm lint and pnpm build are clean. Fixes: accesslayerorg#178 Fixes: accesslayerorg#179 Fixes: accesslayerorg#180 Fixes: accesslayerorg#181
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bundles four issues into one PR.
utils/wallet-ownership.utils.tsexposes a single typed verdict (granted/wallet_not_found/forbidden) for "does this Stellar wallet own this creator profile?".middlewares/wallet-ownership.middleware.tsturns the verdict into HTTP responses with the existing{ success: false, error: { code, message } }shape. Wired intoPUT /api/v1/creators/:creatorId/profile— previously open, now requires the owning wallet in thex-wallet-addressheader. 13 new tests cover authorized and unauthorized paths.creator.service.test.ts(pagination math, sort options, parallel query, edge cases) andcreator-profile.service.test.ts(read shape, upsert envelope, schema-boundary contract). Tests mock prisma at the module boundary so they stay isolated from unrelated modules and remain deterministic.prisma/seed.tscreates three deterministic users (alice / bob / charlie) with wallets and creator profiles — enough to exercise list / read / ownership-gated update flows.docs/contributor-seed.mddocuments the fixture catalogue, reset workflow, and the exact requests that exercise each gated path.CONTRIBUTING.mdlinks the new doc.docs/release-checklist.mdwith pre-deploy / rollout / post-deploy / rollback sections. Concrete and operational — real commands (pnpm exec prisma migrate diff,GET /api/v1/health/detailed), real endpoint names — so a contributor can use it cold without additional context.Test plan
pnpm lint— cleanpnpm build— cleanpnpm exec jest— 99 tests pass across 10 suites (was 73 across 6 on main; +26 new tests, no regressions)PUT /api/v1/creators/alice/profilewithx-wallet-address: GA7XLM…ALICEreturns 200 (manual; needs the seed)x-wallet-address: GA7XLM…CHARLIEreturns 403 (manual; needs the seed)Pre-existing failures
mainalready has 8 test suites that error with "Your test suite must contain at least one test" — older bespoke test scripts that ran assertions in plain code withoutdescribe/it. This PR does not touch them; the same 8 suites still fail on this branch. Worth a follow-up issue if any of them carry behavior that should be retained.Fixes